<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('超限记录列表')" />
	<th:block th:include="include :: layout-latest-css" />
	<th:block th:include="include :: ztree-css" />
	<style type="text/css">
		.table {table-layout:fixed;}
	</style>
</head>
<body class="gray-bg">
    <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
					<form id="user-form">
				<div class="select-list">
						<ul>
							<li>
							 	<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="startTime" readonly="readonly"/>
							</li>
							<li>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime" readonly="readonly"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="getdata()"><i class="fa fa-search"></i>&nbsp;数据重算</a>
							</li>
						</ul>
					</div>
					</form>
				</div>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: layout-latest-js" />
	<script type="text/javascript">
   	 function getdata(){
   		 $.ajax({
	            type: "POST",
	            url: "/overrun/calSelf/calDataJson",
	            data: {
	            	"startTime": $("#startTime").val(),
   		 			"endTime":  $("#endTime").val()
	            },
	            dataType: 'html',
	            beforeSend: function () {
    	        	$.modal.loading("正在处理中，请稍后...");
    	        },
	            success: function(result) {
	                if (result == "success") {
	                	$.modal.alertSuccess("重算完成");
					} else {
						$.modal.alertError(result.msg);
					}
	                $.modal.closeLoading();
	            },
	            error: function(error) {
	            	alert(error);
	            	$.modal.closeLoading();
	            }
	        });
   	 }
	</script>
</body>
</html>